home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / applications / wp / xdmd1.lha / FileOp.xdme < prev    next >
Text File  |  1994-10-29  |  2KB  |  76 lines

  1. /* FileOp.xdme */
  2.  
  3. if ~show("L","rexxreqtools.library") then
  4.     if ~addlib("rexxreqtools.library", 0, -30) then exit
  5.  
  6. Parse Arg HAIL .
  7.  
  8. tagstr = "rt_reqpos=reqpos_centerscr rtfi_flags=freqf_patgad"
  9. select
  10.     when HAIL = "Saveas" then do
  11.         oktext = "_Save"
  12.         hailstr = "Save File As ..."
  13.         tagstr = tagstr || "|freqf_save"
  14.     end
  15.     when HAIL = "Replace" then do
  16.         oktext = "_Load"
  17.         hailstr = "Replace File With ..."
  18.     end
  19.     when HAIL = "Decrypt" then do
  20.         oktext = "_Load"
  21.         hailstr = "Select File to Decrypt ..."
  22.     end
  23.     otherwise exit
  24. end
  25.  
  26. options results
  27. address 'XDME.1'
  28. 'rxresult $path'
  29. P = result
  30. 'rxresult $fname'
  31. N = result
  32. 'rxresult $filename'
  33. OF = result
  34.  
  35. F = rtfilerequest(P,N,hailstr,oktext,tagstr)
  36. if rtresult = 0 then exit
  37.  
  38. F0 = '(' || F || ')'
  39. F1 = '"' || F || '"'
  40.  
  41. if HAIL = "Decrypt" then do
  42.     xcom = "execute (copy" F1 "t:temp)"
  43.     xcom
  44.     password = rtgetstring(,,"Please Enter Password")
  45.     xcom = 'execute (xpack t:temp password "' || password || '")'
  46.     xcom
  47.     if OF ~= F then do
  48.         newwindow
  49.     end
  50.     newfile 't:temp'
  51.     chfilename F0
  52.     xcom = 'settvar password' password
  53.     xcom
  54.     call Mode(F)
  55. end
  56. else do
  57.     C = 'menudel Window (' || N || ')'
  58.     C
  59.  
  60.     if HAIL = "Replace" then do
  61.         newfile F0
  62.         call Mode(F)
  63.     end
  64.     else do /* HAIL = "Saveas" */
  65.         chfilename F0
  66.         call Save()
  67.     end
  68. end
  69.  
  70. PL = lastpos("/", F)
  71. if PL = 0 then PL = lastpos(":", F)
  72. N = delstr(F, 1, PL)
  73.  
  74. C = 'menuadd Window (' || N || ') (select (window=' || N || '))'
  75. C
  76.